package com.oversea.service.impl;

import org.hibernate.Query;
import com.oversea.models.Major;
import com.oversea.service.MajorService;

public class MajorServiceImpl extends CommonServiceImpl<Major> implements
		MajorService {

	public Major getMajorByName(String name) {
		String hql = "from Major where deleted = ? and majorName like '%"
				+ name + "'%";
		Query query = getSession().createQuery(hql);
		query.setBoolean(0, false);
		query.setString(1, name);
		return (Major) query.uniqueResult();
	}

}
